#pragma once

#include <cstdlib>
#include <cstring>
#include <string>
#include <vector>
#include <memory>

using std::shared_ptr;

//using std::string;
//using std::vector;
typedef struct _BuildingBarInfor
{
  bool isOptFinished_;
  int width_;
  int length_;
  int floor_height_;
  int construt_height_;
  int inner_col_rows_;
  int primary_direction_;
  int no_of_secondarys_;
  int no_of_spans_;
  int no_of_stories_;
  std::vector<int> possible_spans_;
  std::vector<int> column_spans_;
  std::vector<int> genes_string_;
  std::string working_dir_;
  std::string database_path_;
} BuildingBarInfor;

class BuildingBar
{
  //shared_ptr<BuildingBarInfor> bar_;
  BuildingBarInfor* bar_;
public:
  BuildingBar(std::string path);
  ~BuildingBar(void);

  int Width() const { return bar_->width_; }
  void Width(int val) { bar_->width_ = val; }
  int Length() const { return bar_->length_; }
  void Length(int val) { bar_->length_ = val; }
  int FloorHeight() const { return bar_->floor_height_; }
  void FloorHeight(int val) { bar_->floor_height_ = val; }
  int ConstrutHeight() const { return bar_->construt_height_; }
  void ConstrutHeight(int val) { bar_->construt_height_ = val; }
  int InnerColRows() const { return bar_->inner_col_rows_; }
  void InnerColRows(int val) { bar_->inner_col_rows_ = val; }
  int No_of_stories() const { return bar_->no_of_stories_; }
  void No_of_stories(int val) { 
    bar_->no_of_stories_ = val; 
    bar_->genes_string_.resize(11+bar_->no_of_stories_*4);
  }


  std::vector<int>& Genes_string() const { return bar_->genes_string_; }
  void Genes_string(std::vector<int>& val) { bar_->genes_string_ = val; }
  bool IsOptFinished() const { return bar_->isOptFinished_; }

  std::vector<int>& ColumnSpans() { return bar_->column_spans_; }
  void PossibleSpans( std::vector<int>& val) { bar_->possible_spans_ = val; }
  //void Spans(const vector<int>& val) { spans_ = val; }
  void CurrentDirectory(std::string path){
    bar_->working_dir_ = path; 
    bar_->database_path_ = path.append("/DataBase.txt");}
  const char* CurrentDirectory();
  void RunGenerator();

  const char* Name() const;
};

